// 云函数入口文件
const cloud = require('wx-server-sdk')
cloud.init({
    env: "cloudwx-dm78q"
})
DB = cloud.database().collection("productType");

cloud.init()

// 云函数入口函数
exports.main = async (event, context) => {
    //修改该id的数据
    return DB.doc(event.newData.id).update({
        data: {
            name: event.newData.name,
            number: event.newData.number,
            memo: event.newData.memo
        }
    })
        .then(res => {
            console.log(res);
            this.clearInput();
        }).catch(console.error)

}